home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 13 / AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso / rexx / rexxtest.rexx < prev    next >
OS/2 REXX Batch file  |  1996-02-24  |  4KB  |  186 lines

  1. /* RexxTest mit Menus&More                */
  2. /* §VER: 2.00 (24.04.96)                   */
  3. /* © 1995,96 by Axel Sodtalbers, Göttingen */
  4.  
  5. OPTIONS RESULTS                                     /* Init */
  6. ADDRESS "MMPlayer"
  7.  
  8. 'ALOHAPLAYER'
  9. oldmsg = ''
  10. 'DrawColor 0'
  11.  
  12. 'SwitchTitle 0'
  13.  
  14. /* -------------------------------------------------------- */
  15.  
  16. call MessageOut '"Query Function..."' 
  17.  
  18. msg = "'Query is giving the following results:||"
  19. msg = msg || 'PlLeft      : '
  20. 'QUERY PLLEFT'
  21. msg = msg || RESULT || '|PlTop       : '
  22. 'QUERY PLTOP'
  23. msg = msg || RESULT || '|PlWidth     : '
  24. 'QUERY PLWIDTH'
  25. msg = msg || RESULT || '|PlHeight    : '
  26. 'QUERY PLHEIGHT'
  27. msg = msg || RESULT || '|PlPlanes    : '
  28. 'QUERY PLPLANES'
  29. msg = msg || RESULT || '|PlColors    : '
  30. 'QUERY PLCOLORS'
  31. msg = msg || RESULT || '||MMRexxDebug : '
  32. 'QUERY MMREXXDEBUG'
  33. msg = msg || RESULT || '||IsGerman    : '
  34. 'QUERY ISGERMAN'
  35. msg = msg || RESULT || "|'"
  36.  
  37. 'Req' msg 'Understood'
  38.  
  39.  
  40. /* -------------------------------------------------------- */
  41.  
  42. AX = 100
  43. AY = 40
  44. AW = 440
  45. AH = 130
  46.  
  47. 'DrawColor 1'
  48. 'DrawRectFill' AX AY AX + AW AY + AH
  49.  
  50. call MessageOut '"Testing: DrawLine Function..."'
  51.  
  52. 'SetWaitPointer'                                        /* DrawLine   */
  53.  col = 4
  54. 'DrawColor' col
  55.  
  56. do px=AX to AX + AW by 4
  57.    'DrawLine' AX AY px AY + AH
  58.    'DrawColor' col
  59.    col = col + 1
  60.    if col = 8 then col=4
  61. end
  62.  
  63. col = 4
  64. do px=AX + AW to AX by -4
  65.    'DrawLine' AX + AW AY px AY + AH
  66.    'DrawColor' col
  67.    col = col + 1
  68.    if col = 8 then col=4
  69. end  
  70.  
  71. col = 4
  72. do px=AX to AX + AW by 4
  73.    'DrawLine' AX AY + AH px AY
  74.    'DrawColor' col
  75.    col = col + 1
  76.    if col = 8 then col=4
  77. end  
  78.  
  79. col = 4
  80. do px=AX + AW to AX by -4
  81.    'DrawLine' AX + AW AY + AH px AY
  82.    'DrawColor' col
  83.    col = col + 1
  84.    if col = 8 then col=4
  85. end  
  86. 'ResetPointer'
  87. Call Wait
  88.  
  89.  
  90. Call MessageOut "'DrawCircle Function...'"
  91. do rad=20 to 60 BY 3
  92.   'DrawColor' random(4,7) 
  93.   'DrawCircle' (AX+(AX+AW))/2 (AY+(AY+AH))/2 rad
  94. end
  95. Call Wait
  96.  
  97. Call MessageOut "'DrawRectangle Function...'"           /* DrawRectangle */ 
  98. x1 = ax
  99. y1 = ay
  100. x2 = ax+aw
  101. y2 = ay+ah
  102.  
  103. do while y2>(AY+(AY+AH))/2
  104.   x1 = x1+3
  105.   y1 = y1+3
  106.   x2 = x2-3
  107.   y2 = y2-3
  108.   'DrawColor' random(4,7)
  109.   'DrawRectangle' x1 y1 x2 y2
  110. end  
  111. Call Wait
  112.  
  113. Call MessageOut "'DrawRectFill Function...'"           /* DrawRectFill */
  114. x1 = ax
  115. y1 = ay
  116. x2 = ax+aw
  117. y2 = ay+ah
  118.  
  119. do while y2>(AY+(AY+AH))/2
  120.   x1 = x1+3
  121.   y1 = y1+3
  122.   x2 = x2-3
  123.   y2 = y2-3
  124.   'DrawColor' random(4,7)
  125.   'DrawRectFill' x1 y1 x2 y2
  126. end  
  127. Call Wait 
  128.  
  129. Call MessageOut "'Some pixels now...'"                  /* DrawPixel */
  130. do px=1 to 100
  131.    'DrawColor' random(4,7)
  132.    'DrawPixel' random(ax, ax+aw) random(ay,ay+ah)
  133. end
  134. Call Wait
  135.  
  136. Call MessageOut "'And now some other requesters...'"    /* Reqs */
  137.  
  138. "ReqFile 'Select a file!' S:Startup-Sequence"
  139. Call MessageOut "'Your selection: " || RESULT || "'" 
  140. Call Wait  
  141.  
  142. "ReqDir 'Select a drawer!' RAM:"
  143. Call MessageOut "'Your selection: " || RESULT || "'" 
  144. Call Wait
  145.  
  146. 'ReqString "Please type in some text now!" YourText'
  147. Call MessageOut "'Your selection: " || RESULT || "'"
  148. Call Wait  
  149.  
  150. 'Req "Now we are switching||to another screen..." "Do the switch!"'
  151. 'SwitchScreen "PROGDIR:Examples/Logo.pic"'
  152.  
  153. 'Req "Okay, folks - that was the Menus&More ARexx Demo||For more information consult the M&M.guide...|" "Understood"'
  154.  
  155. /* -------------------------------------------------------------- */
  156.  
  157. exit
  158.  
  159.  
  160.  
  161. MessageOut:    /* Demo-Typ auf Bildschirm */
  162.     procedure expose oldmsg
  163.     parse arg msg
  164.  
  165.     'DrawColor 4'
  166.     'DrawText 130, 223,' oldmsg
  167.      oldmsg = msg
  168.     'DrawColor 2'
  169.     'DrawText 130, 223,' msg
  170.  
  171. return
  172.  
  173.  
  174. Wait:           /* Auf Mausklick warten */
  175.  
  176.     'SwitchTitle 1'
  177.     'SetTitle "Please press left mouse button or space-key!"'
  178.     'WaitForLMB'
  179.     'SwitchTitle 0'
  180.     'DrawColor 1'
  181.     'DrawRectFill' AX AY AX + AW AY + AH
  182. return
  183.  
  184.  
  185.  
  186.